﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Guide
{
    public class Province
    {
        private string _provinceID;

        public string ProvinceID
        {
            get { return _provinceID; }
            set { _provinceID = value; }
        }

        private string _provinceCName;

        public string ProvinceCName
        {
            get { return _provinceCName; }
            set { _provinceCName = value; }
        }
        private string _clusterID;

        public string ClusterID
        {
            get { return _clusterID; }
            set { _clusterID = value; }
        }

        public static List<Province> getProvice()
        {
            int maxi=20;
            int maxj=5;
            List<Province> list = new List<Province>();
            for (int i = 0; i < maxi; i++)
            {
                for (int j = 0; j <maxj; j++)
                {
                    list.Add(new Province()
                        {
                            ProvinceID = (i * maxi + j).ToString(),
                            ProvinceCName = "ShanDong" + i,
                            ClusterID = "Cluster" + j
                        });
                }

            }
            return list;
        }
    }

    class Cluster
    {
        private string _clusterName;

        public string ClusterName
        {
            get { return _clusterName; }
            set { _clusterName = value; }
        }
        private int _provinceNum;

        public int ProvinceNum
        {
            get { return _provinceNum; }
            set { _provinceNum = value; }
        }
    }
    //class ProductComparer : IEqualityComparer<Province>
    //{
    //    // Products are equal if their names and product numbers are equal.
    //    public bool Equals(Product x, Product y)
    //    {

    //        //Check whether the compared objects reference the same data.
    //        if (Object.ReferenceEquals(x, y)) return true;

    //        //Check whether any of the compared objects is null.
    //        if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null))
    //            return false;

    //        //Check whether the products' properties are equal.
    //        return x.Code == y.Code && x.Name == y.Name;
    //    }

    //    // If Equals() returns true for a pair of objects 
    //    // then GetHashCode() must return the same value for these objects.

    //    public int GetHashCode(Product product)
    //    {
    //        //Check whether the object is null
    //        if (Object.ReferenceEquals(product, null)) return 0;

    //        //Get hash code for the Name field if it is not null.
    //        int hashProductName = product.Name == null ? 0 : product.Name.GetHashCode();

    //        //Get hash code for the Code field.
    //        int hashProductCode = product.Code.GetHashCode();

    //        //Calculate the hash code for the product.
    //        return hashProductName ^ hashProductCode;
    //    }

    //}


}